package com.zyf.chapter01.principle.SOLID.ISP.iteration.first;

import com.zyf.chapter01.principle.SOLID.ISP.ZookeeperConfigSource;
import com.zyf.chapter01.principle.SOLID.ISP.ConfigSource;

/**
 * @author yifeng
 */
public class Application {
    static ConfigSource configSource = new ZookeeperConfigSource(/*省略参数*/);
    public static final RedisConfig redisConfig = new RedisConfig(configSource);
    public static final KafkaConfig KafkaConfig = new KafkaConfig(configSource);
    public static final MysqlConfig mysqlConfig = new MysqlConfig(configSource);

    public static void main(String[] args) {
        // 热更新
        ScheduledUpdater redisConfigUpdater = new ScheduledUpdater(redisConfig,100, 100);
        redisConfigUpdater.run();
        ScheduledUpdater kafkaConfigUpdater = new ScheduledUpdater(KafkaConfig,100, 100);
        kafkaConfigUpdater.run();
    }
}
